﻿<UserControl x:Class="YouTubePlaylist.Views.YouTubeApp"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:Views="clr-namespace:YouTubePlaylist.Views"
    xmlns:Controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"
    FontSize="10" FontFamily="verdana">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition MinWidth="650"/>
            <ColumnDefinition MaxWidth="325"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="30"/>
        </Grid.RowDefinitions>
        <Popup x:Name="Popup" IsOpen="False"/>
        <Border Grid.Row="0" Grid.Column="0" CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
            <Views:PlaylistCtrl PlaylistModel="{Binding PlayingPlaylists.Current}"/>
        </Border>
        <Grid Grid.Row="0" Grid.Column="1">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Border Grid.Row="0" CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                <Views:UserCtrl User="{Binding Model.User}"/>
            </Border>
            <Controls:Expander Grid.Row="1" Header="Now Playing" IsExpanded="True">
                <Border CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                    <Views:PlaylistsCtrl PlaylistsModel="{Binding PlayingPlaylists}"/>
                </Border>
            </Controls:Expander>
            <Controls:Expander Grid.Row="2" Header="My Playlists" IsExpanded="True">
                <Border CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                    <Views:PlaylistsCtrl PlaylistsModel="{Binding MyPlaylists}"/>
                </Border>
            </Controls:Expander>
            <StackPanel Grid.Row="3">
                <Controls:Expander Header="Search for Playlists" IsExpanded="False">
                    <Border CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                        <Views:PlaylistsSearchCtrl PlaylistsModel="{Binding FoundPlaylists}"/>
                    </Border>
                </Controls:Expander>
                <Controls:Expander Header="New Playlists" IsExpanded="False">
                    <Border CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                        <Views:PlaylistsCtrl PlaylistsModel="{Binding MostRecentlyCreatedPlaylists}"/>
                    </Border>
                </Controls:Expander>
                <Controls:Expander Header="Most Active Playlists" IsExpanded="False">
                    <Border CornerRadius="10" BorderThickness="2" BorderBrush="Black" Margin="5" Padding="5">
                        <Views:PlaylistsCtrl PlaylistsModel="{Binding MostRecentlyUpdatedPlaylists}"/>
                    </Border>
                </Controls:Expander>
            </StackPanel>       
        </Grid>
        <Grid Grid.Row="1" Grid.ColumnSpan="2" Margin="5">
            <ProgressBar IsIndeterminate="{Binding Model.IsCalculating}"/>
            <TextBlock Text="{Binding Model.Status}" VerticalAlignment="Center" Margin="10,0,0,0"/>
        </Grid>
    </Grid>
</UserControl>
